package top.lixunda.ecommerce.server.good.api.entity.db;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * <p>
 * 店铺物流地址表，一对多，可设置多个，拥有默认
 * </p>
 *
 * @author Xumda
 * @since 2019-12-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("store_logistics_address")
public class StoreLogisticsAddressDO extends Model<StoreLogisticsAddressDO> {

    private static final long serialVersionUID=1L;

    /**
     * 自动生成主键Id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 物流地址自定义名称
     */
    @TableField("title")
    private String title;

    /**
     * 店铺名称
     */
    @TableField("store_id")
    private Integer storeId;

    /**
     * 省级id
     */
    @TableField("province_id")
    private Integer provinceId;

    /**
     * 身份名称
     */
    @TableField("province_name")
    private String provinceName;

    /**
     * city_id
     */
    @TableField("city_id")
    private Integer cityId;

    /**
     * city_name
     */
    @TableField("city_name")
    private String cityName;

    /**
     * county_id
     */
    @TableField("county_id")
    private Integer countyId;

    /**
     * county_name
     */
    @TableField("county_name")
    private String countyName;

    /**
     * town_id
     */
    @TableField("town_id")
    private Integer townId;

    /**
     * town_name
     */
    @TableField("town_name")
    private String townName;

    /**
     * village_id
     */
    @TableField("village_id")
    private Integer villageId;

    /**
     * village_name
     */
    @TableField("village_name")
    private String villageName;

    /**
     * 详细地址
     */
    @TableField("detail")
    private String detail;

    /**
     * 邮编，可以为空，应为邮编可以通过地址自动查询
     */
    @TableField("postal")
    private String postal;

    /**
     * 发件人名称
     */
    @TableField("name")
    private String name;

    /**
     * 发件人联系方式
     */
    @TableField("phone")
    private String phone;

    /**
     * 是否是默认地址  1 默认 0 不是默认 默认不是默认
     */
    @TableField("is_default")
    private String isDefault;

    /**
     * 是否删除
     */
    @TableField("useable")
    @TableLogic
    @JsonIgnore
    private Integer useable;

    /**
     * 备注
     */
    @TableField("remark")
    private String remark;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
